package com.open.micro.service.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.annotation.Commit;

import com.open.micro.service.dataaccess.dataobject.UserDo;
import com.open.micro.service.service.UserService;
import com.spring.model.ResultModel;
import com.spring.model.TraceIdHelper;


@Commit
public class UserServiceFallBack implements UserService {
	
	private static final Logger LOGGER = LoggerFactory.getLogger( UserServiceFallBack.class );

	@Override
	public List<UserDo> listAllUsers(Integer page, Integer pageSize) {
		LOGGER.error("traceId:{}, UserServiceFallBack, listAllUsers fail, page:{}, pageSize:{}",
				TraceIdHelper.getTraceId());
		return new ArrayList<>();
	}

	@Override
	public ResultModel<UserDo> addUser(String userId, String userName) {
		LOGGER.error("traceId:{}, UserServiceFallBack, listAllUsers fail, page:{}, pageSize:{}",
				TraceIdHelper.getTraceId());
		return ResultModel.createFail("internalErr");
	}

}
